home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / comm / tcp / Amster-main.lha / Amster_Install / Rexx / MakeServerList.rexx < prev    next >
OS/2 REXX Batch file  |  2000-10-14  |  1KB  |  44 lines

  1. /*
  2. ** Napigator Server List Parser
  3. ** $VER: MakeServerList.rexx 0.1 (12.9.2000)
  4. **
  5. ** By Roger Clark (kaedric@texas.net)
  6. ** September 12, 2000
  7. **
  8. */
  9.  
  10. Options Results
  11.  
  12. crnl = '0d0a'x
  13.  
  14. If ShowList('H','TCP') Then Do
  15.   If Open(Website,'TCP:www.napigator.com/80','W') Then Do
  16.     Call WriteCh(Website,'GET /servers.php?version=108 HTTP/1.0')
  17.     Call WriteCh(Website,'User-Agent: MakeServerList/0.1;'||crnl)
  18.     Call WriteCh(Website,'Accept: *;q=1'||crnl)
  19.     Call WriteCh(Website,'Host: www.napigator.com'||crnl)
  20.     Call WriteCh(Website,crnl)
  21.     Data = ReadLn(Website)
  22.     If Subword(Data,2,1) ~= 200 Then Do
  23.       Call WriteLn(Website,'Quit')
  24.       Call Close(Website)
  25.       Say 'Error encountered.'
  26.       Exit
  27.     End
  28.     Call Open(Output,'Ram:Amster.servers','W')
  29.       Do Until EOF(Website)
  30.         Data = ReadLn(Website)
  31.         If Pos('.',Word(Data,1)) > 0 Then Call WriteLn(Output,Word(Data,1)' 'Word(Data,2)' 0 COMMENT "'Word(Data,7)'"')
  32.       End
  33.     Call Close(Output)
  34.     Call WriteLn(Website,'Quit')
  35.     Call Close(Website)
  36.     Say 'Ram:Amster.servers has been sucessfully created!'
  37.   End
  38.   Else Say 'Unable to connect to napigator.com'
  39. End
  40. Else Do
  41.   Say 'Could not access the web.  Is your TCP stack started?'
  42. End
  43. Exit
  44.